`timescale 1ns / 1ps
// module name: decoder
// description: n-N decoder
// author: yangtao2019
// date: 2021.07.11

`timescale 1ns / 1ps

module decoder
#(
    parameter n = 5,
    parameter N = (2<<n)
)
(
    input [n-1:0] addr,
    output reg [N-1:0] paths
);

always @ (*) begin: nN_decoder
    integer i;
    for (i=0; i<N; i=i+1) begin
        if (addr == i)
            paths[i] = 1'b1;
        else
            paths[i] = 1'b0;
    end
end

endmodule